<{include file="ucenter/block/header.html"}>
<div class="ucenter_t">
    <ul>
        <li><a href="<{link ctl='ucenter/weixin:info'}>">公众号设置</a></li>
        <li><a href="<{link ctl='ucenter/weixin:config'}>">接口设置</a></li>
        <li class="on"><a href="<{link ctl='ucenter/weixin:welcome'}>">关注回复</a></li>
        <li><a href="<{link ctl='ucenter/weixin:leaflets'}>">宣传页设置</a></li>
        <li><a href="<{link ctl='ucenter/weixin/menu:index'}>">微信菜单</a></li>
    </ul>
</div>
<div class="ucenter_c">
<p class="tips"><span class="notice">当有用户关注时自动回复消息</span></p>
<form action="<{link ctl='ucenter/weixin:welcome'}>" mini-form="ucenter" method="post" ENCTYPE="multipart/form-data">
<table cellspacing="0" cellpadding="0" class="form">   
<tr><th>公众号：</th><td><b class="blue"><{$weixin.wx_name}>(<{$weixin.wx_sid}>)</b></td></tr>
<tr>
    <th>回复类型：</th>
    <td>
        <label><input type="radio" name="data[type]" <{if empty($welcome.type) || $welcome.type=='text'}>checked="checked"<{/if}> value="text"/>文本回复</label>
        <label><input type="radio" name="data[type]" <{if $welcome.type=='reply'}>checked="checked"<{/if}> value="reply"/>图文回复</label>&nbsp;&nbsp; <br />
    </td>
</tr>
<tr wxtype="text" <{if $welcome.type && $welcome.type!='text'}>class="none"<{/if}>>
    <th>回复内容：</th>
    <td><textarea name="data[content]" class="textarea w-300"><{$welcome.content}></textarea></td>
</tr>
<tr wxtype="reply" <{if $welcome.type!='reply'}>class="none"<{/if}>>
    <th>回复图文：</th>
    <td>
        <input type="hidden" name="data[reply_id]" value="<{$welcome.reply_id}>" id="weixin_reply_id"/>
        <div class="weixin-preview<{if !$reply}> none<{/if}>" style="float:left;">
            <div class="weixin-box">
                <p class="weixin-title" id="weixin_reply_title"><{$reply.title}></p>
                <div class="weixin-cover"><img class="weixin-cover-pic" id="weixin_reply_photo" src="<{$pager.img}>/<{$reply.photo}>"></div>
            </div>
        </div>
        <a href="<{link ctl='ucenter/weixin/reply:dialog'}>" id="weixin_reply_btn" class="pbtn" title="选择微信素材">选择微信素材</a>
    </td>
</tr>
<tr><th></th><td><input type="submit" value="保存" class="green_btn" /></td></tr>
</table>
</form>
</div>
<script type="text/javascript">
(function(K, $){
$("input[name='data[type]']").click(function(){
    $("tr[wxtype]").hide();
    $("tr[wxtype='"+$(this).val()+"']").show();
});
$("#weixin_reply_btn").click(function(e){
    e.stopPropagation(); e.preventDefault();
    var link = $(this).attr("action") || $(this).attr("href");
    Widget.Dialog.Select(link, 'N', function(ret){
        $("#weixin_reply_id").val(ret[0]);
        $("#weixin_reply_title").html(ret[1].title);
        $("#weixin_reply_photo").attr("src", "<{$pager.img}>/"+ret[1].photo);
        $(".weixin-preview").show();
    }, {title:"选择微信素材",width:720});
});
})(window.KT, window.jQuery);
</script>
<{include file="ucenter/block/footer.html"}>